home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / SOUND.SWG / 0011_SOUNDOFF.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  1KB  |  33 lines

  1. {
  2. STEVEN TALLENT
  3.  
  4. > I am look For a piece of code [...] that will turn off the speaker.
  5.  
  6. This is tested code, and should do the trick.  It does its work by
  7. turning off the PC speaker 18.2 times per second.  This should reduce
  8. any Sound to maybe a click or two.  Unfortunately, some games and
  9. music software will bypass it (ModPlay, Wolfenstein), but most beeps
  10. and whistles will be gone.  This is a TSR Program, and takes about 3k
  11. memory (yuk), but you can load it high if you want.  I've found it
  12. especially useful during late-night BBSing (no alarms at connect/File
  13. xfer finish). Hope this does the trick!  Considering its size and
  14. relative isolation from normal Programs, I didn't see fit to use CLI/STI.
  15. }
  16.  
  17. {$M 1024,0,0}  {BTW, is there any way to make this smaller?!?}
  18. {$N-,S-,G+} { Use g- For 8088 systems, g+ For V20 and above }
  19. Program NoSpeak;
  20. Uses
  21.   Dos;
  22.  
  23. Procedure ShutOff; INTERRUPT;
  24. begin
  25.   Port [97] := Port[97] and 253; {Turn off speaker and disconnect timer}
  26. end;
  27.  
  28. begin
  29.   SetIntVec( $1C, @ShutOff);
  30.   Keep(0);
  31. end.
  32.  
  33.